<HTML>
<HEAD>
<TITLE>Device::Modem - Perl extension to talk to AT devices connected via serial port</TITLE>
<LINK REV="made" HREF="mailto:cosimo@dev.xproject.org">
</HEAD>

<BODY>

<A NAME="__index__"></A>
<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#name">NAME</A></LI>
	<LI><A HREF="#warning">WARNING</A></LI>
	<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
	<LI><A HREF="#description">DESCRIPTION</A></LI>
	<UL>

		<LI><A HREF="#requires">REQUIRES</A></LI>
		<LI><A HREF="#export">EXPORT</A></LI>
	</UL>

	<LI><A HREF="#author">AUTHOR</A></LI>
	<LI><A HREF="#see also">SEE ALSO</A></LI>
</UL>
<!-- INDEX END -->

<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Device::Modem - Perl extension to talk to AT devices connected via serial port</P>
<P>
<HR>
<H1><A NAME="warning">WARNING</A></H1>
<PRE>
   This is C&lt;PRE-ALPHA&gt; software, still needs extensive testing and
   support for generic AT commads, so use it at your own risk,
   and without C&lt;ANY&gt; warranty! Have fun.</PRE>
<P>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
  use Device::Modem;</PRE>
<PRE>
  my $modem = new Device::Modem( port =&gt; '/dev/ttyS1', baud =&gt; 9600 )</PRE>
<PRE>
  if( $modem-&gt;connect() ) {
      print &quot;connected!\n&quot;;
  } else {
      print &quot;sorry, no connection with serial port!\n';
  }</PRE>
<PRE>
  $modem-&gt;attention();          # send `attention' sequence (+++)
</PRE>
<PRE>

  $modem-&gt;disl( '022704690' );  # dial number (*NOT WORKING YET*)</PRE>
<PRE>

  $modem-&gt;echo(1);              # enable local echo
  $modem-&gt;echo(0);              # disable it</PRE>
<PRE>
  $modem-&gt;offhook();            # Take off hook (ready to dial)
  $modem-&gt;hangup();             # returns modem answer
  $modem-&gt;reset();              # hangup + attention + restore setting 0 (Z0)</PRE>
<PRE>
  $modem-&gt;restore_factory_settings();
                                # Handle with care!</PRE>
<PRE>
  $modem-&gt;send_init_string();   # Send initialization string
                                # Now this is fixed to `ATZ0H0V1Q0E0'</PRE>
<PRE>
  $modem-&gt;repeat();             # Repeat last command</PRE>
<PRE>
  $modem-&gt;verbose(0);           # Modem responses are numerical
  $modem-&gt;verbose(1);           # Normal text responses
</PRE>
<PRE>

  #
  # Some raw at commands
  #
  $modem-&gt;atsend( 'ATH0' );
  print $modem-&gt;answer();</PRE>
<PRE>
  $modem-&gt;atsend( 'ATDT01234567' . Device::Modem::CR );
  print $modem-&gt;answer();</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>Device::Modem class implements basic AT device abstraction. It is meant
to be inherited by sub classes (as Device::Gsm), which are
based on serial connections.</P>
<P>
<H2><A NAME="requires">REQUIRES</A></H2>
<DL>
<DT><STRONG><A NAME="item_Device%3A%3ASerialPort">Device::SerialPort</A></STRONG><BR>
<DD>
</DL>
<P>
<H2><A NAME="export">EXPORT</A></H2>
<P>None</P>
<P>
<HR>
<H1><A NAME="author">AUTHOR</A></H1>
<P>Cosimo Streppone, <A HREF="mailto:cosimo@cpan.org">cosimo@cpan.org</A></P>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P>Device::SerialPort(3), perl(1).</P>

</BODY>

</HTML>
